<?php
session_start();
$return_arr = array();
require_once('Connections/tecno.php'); 
mysql_select_db($database_tecno, $tecno);

/* If connection to database, run sql statement.   OR cedula like '%".$_GET['term']."%' */
if ($tecno)
{
	$fetch = mysql_query("SELECT * FROM datospersonales where nombres like '%".$_GET['term']."%'  OR primerApellido like '%".$_GET['term']."%' OR cedula like '%".$_GET['term']."%' ORDER  BY cedula"); 

	/* Retrieve and store in array the results of the query.*/

	while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) {
		$row_array['id'] = $row['id'];		
		$row_array['value'] = $row['cedula']." ".$row['nombres'].", ".$row['primerApellido'];
		$row_array['cedula'] = $row['cedula'];
        array_push($return_arr,$row_array);
    }
}

/* Free connection resources. */
mysql_close($tecno);

/* Toss back results as json encoded array. */
echo json_encode($return_arr);


?>